#!/bin/bash  
  
# 定义函数来打开新的终端窗口并执行命令  
function open_terminal_and_run {  
    gnome-terminal --tab -- bash -c "cd $1; $2; exec bash"  
}  

# 运行mqtt窗口
open_terminal_and_run "./daterreport" "mosquitto"

# 运行设备搜索窗口
#open_terminal_and_run "~/24011/BigPJ/network-management-program/deviceSearch" "make && sudo ./main 192.168.31.166 8088"  

sleep 1
# 运行数据上报窗口  
open_terminal_and_run "./daterreport" "make && ./datareport"  
  
# 运行stm32窗口  
open_terminal_and_run "./singlechip/server" "make &&  ./stm32server"  
  
# 运行modbus窗口  
open_terminal_and_run "./modbus" "make  &&  ./main"

# 运行阿里云窗口
open_terminal_and_run "./alibaba-cloud/alicloud/LinkSDK" "make &&  ./output/data-model-basic-demo "

# 运行video窗口
#open_terminal_and_run "./video/mjpg-streamer" "make &&  ./start.sh "


# 运行web窗口
open_terminal_and_run "./web" "make &&   ./thttpd 8787"